//
//  SWUploadTokenFetchReq.swift
//  ChildStory
//
//  Created by linhan on 16/8/22.
//  Copyright © 2016年 Aiya. All rights reserved.
//

import Foundation

class SWUploadTokenFetchReq: SWBaseRequest
{
    var imageHash:String = ""
    
    override init()
    {
        super.init()
        api = .FetchUploadToken
    }
    
    override var params:Any?
    {
        let param:[String:Any] = ["file_md5":imageHash, "file_suffix":"jpg"]
        return param
    }
    
    override func JSONToModel(_ json:JSON, JSONString:String, JSONData:Data) -> AnyObject?
    {
        return Mapper<SWUploadTokenFetchRsp>().map(JSONString: JSONString)
    }
    
    
}

class SWUploadTokenFetchRsp: NSObject,Mappable
{
    var token:String?
    //var baseURL:String?
    //var saveKey:String?
    
    required init?(map: Map) { }
    
    // Mappable
    func mapping(map: Map) {
        token    <- map["BaseModle.upToken"]
        //baseURL    <- map["data.base_url"]
        //saveKey    <- map["data.resource_key"]
    }
}
